﻿@using FileManager.Entities
@using Telerik.Web.Mvc.UI
@model IEnumerable<Institution>


@{
    ViewBag.Title = "Index";
}

<h2>InstitutionController</h2>

@(Html.Telerik().Grid<Institution>()
            .DataBinding(dataBinding => dataBinding.Ajax().Select("_AjaxSelect", "Institution"))
.Name("Grid")
    .Pageable(paging => paging.PageSize(12)))

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.DateCreated)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.DateUpdated)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.IsValid)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Logo)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.DateCreated)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.DateUpdated)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.IsValid)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Logo,"ImageModel")
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
                @Html.ActionLink("Details", "Details", new { id=item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id=item.Id })
            </td>
        </tr>
}

</table>
